<template>
  <div>
    <div class="con" v-for="item in categoryList" :key="item.id">
      <div class="item">
        <div class="title">{{ item.name }}</div>
        <div class="con">
          <div class="con-item" 
            @click="$router.push({
                name:'desc',
                query:{
                    id:obj.id
                }
            })"

          v-for="obj in item.goodsList" :key="obj.id">
            <img :src="obj.list_pic_url" alt="" />
            <p class="goods_name">{{ obj.name }}</p>
            <span class="con-item_price">${{ obj.retail_price }}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "CategoryList",
  props: {
    categoryList: {
      type: Array,
    },
  },
};
</script>

<style scoped lang="scss">
.title{
    font-size: 36px;
    padding: 30px;
}
.con {
  display: flex;
  flex-wrap: wrap;
  // justify-content: space-evenly;
  font-size: 30px;
  color: #666;
  text-align: center;
  .con-item {
    width: 50vw;
    box-sizing: border-box;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
    padding-bottom: 30px;
  }
  .con-item_price {
    color: #c00000;
  }
  .goods_name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 15px 10px;
  }
}
img {
  width: 40vw;
}
</style>
